package com.udf.flink.scala.apitest.processfunction


import com.udf.flink.scala.apitest.checkpoint.Obj1
import org.apache.flink.streaming.api.scala._

object TestProcessFunction  extends App {
  // 创建执行环境
  val env = StreamExecutionEnvironment.getExecutionEnvironment
  val stream1: DataStream[String] = env.socketTextStream("localhost",9999)

  stream1.map(data => {
      val arr = data.split(",")
      Obj1(arr(0), arr(1), arr(2).toLong)
    })
    .process(new CustomProcessFunction)
    .print("TestProcessFunction")
  env.execute()
}
